Query optimization is based on two main areas: query modeling and query execution. Query designers strive for expressive, understandable and semantical models. The paradigm applied is to declaratively describe a desired result. In contrast, query execution is concerned about the most efficient path of execution. Query execution rarely takes into account concerns such as expressiveness, understandability and semantics. Rather, the only rule it must obey is to guarantee the equivalent informational semantics of the query after and before optimization.
A query optimizer must consider a variety of options and dependencies in order to find the optimal execution path. In addition, the query optimizer must recognize non-trivial patterns that originate from complex business semantics. An optimizer must be maintainable and understandable in order to further develop and change in an iterative manner.